package com.itheima.web.service.impl.pms;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.service.pms.ISkuStockService;
import com.itheima.vo.pms.SkuStock;
import com.itheima.web.mapper.pms.SkuStockMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * sku的库存 服务实现类
 */
@DubboService
public class SkuStockServiceImpl extends ServiceImpl<SkuStockMapper, SkuStock> implements ISkuStockService {
    @Autowired
    private ISkuStockService skuStockService;
    @Override
    public List<SkuStock> getlist(Long pid, String keyword) {
        LambdaQueryWrapper<SkuStock> lqw=new LambdaQueryWrapper<>();
        lqw.eq(SkuStock::getProductId,pid);
        lqw.eq(keyword!=null,SkuStock::getSkuCode,keyword);
        List<SkuStock> list = skuStockService.list(lqw);
        return list;
    }
}
